﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#nullable enable

namespace Xman.Extensions.Core
{
    /// <summary>
    /// 可空的List
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class XList<T> : List<T>
    {
        public XList() : base() { }

        public XList(IEnumerable<T> collection) : base(collection) { }

        public XList(int capacity) : base(capacity) { }

        public new T? this[int index]
        {
            set => base[index] = value;

            get => Count > index ? base[index] : default;
        }
    }
}
